#include <logger.h>
#include <node_api.h>

/* napi_value */
NAPI_MODULE_INIT(/* napi_env env, napi_value exports */)
{
    const napi_node_version *nodeVersion = nullptr;
    if (auto ret = napi_get_node_version(env, &nodeVersion); ret == napi_ok) {
        VALUE_LOGGER(nodeVersion->major); // 17
        VALUE_LOGGER(nodeVersion->minor); // 7
        VALUE_LOGGER(nodeVersion->patch); // 1
        VALUE_LOGGER(nodeVersion->release); // node
    } else {
        VALUE_LOGGER(ret);
    }

    uint32_t numberVersion;
    if (auto ret = napi_get_version(env, &numberVersion); ret == napi_ok) {
        VALUE_LOGGER(numberVersion); // 8
    } else {
        VALUE_LOGGER(ret);
    }
    return exports;
}
